package com.lanhao.aot.carrierintegration.gwe;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.lanhao.aot.aliyun.AliyunOssUtil;
import com.lanhao.aot.carrierintegration.commondto.BizConstants;

import cn.hutool.core.util.XmlUtil;
import cn.hutool.http.HttpRequest;

/**
 * 德国DHL对接
 * 
 * @author kunzhou3
 */
public class GweEspaceUtil {
	private static final Logger LOG = LoggerFactory.getLogger(GweEspaceUtil.class);
	public static final String API_URL = "http://oms.gw-express.com.cn/default/svc/web-service";
	public static final String APP_TOKEN = "66a1928147d685f83c24ab76c7ceae1d";
	public static final String APP_KEY = "66a1928147d685f83c24ab76c7ceae1dd9e951fbb49808ec1e7ff2fdf8b930b5";
	public static final String SERVICE = "createOrder";
	public static final String SERVICE_PRINT = "getLabelUrl";
	public static final String FR_SHIP_METHOD = "PK0162";	// 法国
	public static final String EE_SHIP_METHOD = "PK0123W";  // 东欧
	
	public static final Double DEFAULT_WEIGHT = 0.3d;  // 默认重量
	public static final String CURRENCY = "EUR";
	
	
	public static final String AT = "AT"; // 奥地利
	public static final String DK = "DK"; // 丹麦
	public static final String LU = "LU"; // 卢森堡
	public static final String HU = "HU"; // 匈牙利
	public static final String SK = "SK"; // 斯洛伐克
	public static final String SI = "SI"; // 斯洛文尼亚
	public static final String CZ = "CZ"; // 捷克

	public static void main(String[] args) {
//		String referenceNo = "ANHETESTFRo000311";
//		createOrder(referenceNo, "FR");
		printLabel("GWE240318GWE002740000260");
		
//		String respBody = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://www.example.org/Ec/\"><SOAP-ENV:Body><ns1:callServiceResponse><response>{\"ask\":\"Success\",\"message\":\"Success\",\"Error\":{\"errCode\":\"\",\"errMessage\":\"\"},\"type\":\"pdf\",\"url\":\"http:\\/\\/oms.gw-express.com.cn\\/index\\/get-label?code=GWE240317GWE002740000336&amp;other=0&amp;sign=0f8e3eca1fa08642\",\"reference_no\":\"GWE240317GWE002740000336\",\"time_cost(s)\":0.063498020172119}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>";
//		Map<String, Object> xmlToMap = XmlUtil.xmlToMap(respBody);
//		LOG.info("将XML返回结果转换为Map信息，xmlToMap={}", JSON.toJSONString(xmlToMap));
//		JSONObject xmlObject = JSON.parseObject(JSON.toJSONString(xmlToMap));
//		JSONObject SOAPBody = xmlObject.getJSONObject("SOAP-ENV:Body");
//		JSONObject callServiceResponse = SOAPBody.getJSONObject("ns1:callServiceResponse");
//		String response = callServiceResponse.getString("response");
//		JSONObject respObject = JSON.parseObject(response);
//		String ask = respObject.getString("ask");
//		if ("Success".equals(ask)) {
//			String labelUrl = respObject.getString("url");
//			LOG.info("获取标签文件成功，labelUrl={}", labelUrl);
//			System.out.println(labelUrl);
//			
//			String carrier = "DHL";
//			String trackingNumber = "517146484038";
//			String fileType = "pdf";
//			String fileName = carrier + "_" + trackingNumber + "." + fileType;
//			
//			String ossUrl = AliyunOssUtil.uploadLabel2OSS(fileName, null, carrier, AliyunOssUtil.LABEL_FORM.URL, labelUrl);
//
//			System.out.println(ossUrl);
//		}
	}

	public static void createOrder(String referenceNo, String countryCode) {

		JSONObject paramObject = new JSONObject();
		paramObject.put("reference_no", referenceNo);
		if ("FR".equals(countryCode)) {
			paramObject.put("shipping_method", FR_SHIP_METHOD);
		} else {
			paramObject.put("shipping_method", EE_SHIP_METHOD);
		}
		paramObject.put("country_code", countryCode);
		paramObject.put("order_weight", DEFAULT_WEIGHT);
		paramObject.put("order_pieces", 1);
//		paramObject.put("reference_id", "461983");
//		paramObject.put("shipment_id", "1235646");
//		paramObject.put("POANumber", "64613135");
		
		paramObject.put("total_amount", 0.01); // 订单总金额
		paramObject.put("total_amount_currency", CURRENCY); // 订单总金额币种

		if ("FR".equals(countryCode)) {
			// 仓库地址
			JSONObject Consignee = new JSONObject();
			Consignee.put("consignee_street", "7 rue de Seine");
			Consignee.put("consignee_street2", "");
			Consignee.put("consignee_name", "FR-RTN-AE");
			Consignee.put("consignee_telephone", "0782776186");
			Consignee.put("consignee_postcode", "78130");
			Consignee.put("consignee_province", "Les Mureaux");
			Consignee.put("consignee_city", "Les Mureaux");
			
			paramObject.put("Consignee", Consignee);

			// 发件地址
			JSONObject Shipper = new JSONObject();
			Shipper.put("shipper_countrycode", countryCode);
			Shipper.put("shipper_province", "Munster");
			Shipper.put("shipper_city", "Hem-monacu");
			Shipper.put("shipper_street", "8rueMonacu");
			Shipper.put("shipper_postcode", "80360");
			Shipper.put("shipper_name", "Rouzeflorencealain");
			Shipper.put("shipper_telephone", "0646913415");
			Shipper.put("shipper_mobile", "");
			paramObject.put("Shipper", Shipper);
		} else {
			// 仓库地址
			JSONObject Consignee = new JSONObject();
			Consignee.put("consignee_street", "Weißenseer Weg 73");
			Consignee.put("consignee_street2", "");
			Consignee.put("consignee_name", "DE-RTN-AE（My Place）");
			Consignee.put("consignee_telephone", "015124382982");
			Consignee.put("consignee_postcode", "10369");
			Consignee.put("consignee_province", "BL");
			Consignee.put("consignee_city", "Berlin");
			Consignee.put("consignee_doorplate", "-");
			paramObject.put("Consignee", Consignee);
			
			JSONObject Shipper = new JSONObject();
			Shipper.put("shipper_countrycode", countryCode);
			Shipper.put("shipper_doorplate", "-");
			if("DE".equals(countryCode)) {
				// 发件地址
				Shipper.put("shipper_name", "AnheTest");
				Shipper.put("shipper_province", "Munster");
				Shipper.put("shipper_city", "Borken");
				Shipper.put("shipper_street", "Hoyastraße");
				Shipper.put("shipper_postcode", "48691");
				Shipper.put("shipper_telephone", "07428405089");
				Shipper.put("shipper_mobile", "");
			} else if(AT.equals(countryCode)) { // 奥地利
				Shipper.put("shipper_name", "minjun");
				Shipper.put("shipper_province", "Vienna");
				Shipper.put("shipper_city", "Vienna");
				Shipper.put("shipper_street", "Wiener Stephansdom");
				Shipper.put("shipper_postcode", "1010");
				Shipper.put("shipper_telephone", "225478639");
				Shipper.put("shipper_mobile", "");
				// 下单返回结果将XML返回结果转换为Map信息，xmlToMap={"SOAP-ENV:Body":{"ns1:callServiceResponse":{"response":"{\"ask\":\"Success\",\"message\":\"Success\",\"reference_no\":\"ANHETESTAT000111\",\"shipping_method_no\":\"517146424149\",\"order_code\":\"GWE240206GWE002740000369\",\"track_status\":1,\"sender_info_status\":1,\"ODA\":null,\"agent_number\":\"\",\"system_number\":null,\"tracking_number_list\":{\"U001\":\"517146424149\"},\"time_cost(s)\":2.4335930347443}"}}}
				// 打印面单返回结果：<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Success","message":"Success","Error":{"errCode":"","errMessage":""},"type":"pdf","url":"http:\/\/oms.gw-express.com.cn\/index\/get-label?code=GWE240206GWE002740000369&amp;other=0&amp;sign=808786fab4af7867","reference_no":"GWE240206GWE002740000369","time_cost(s)":0.047866106033325}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
			} else if("DK".equals(countryCode)) { // 丹麦
				Shipper.put("shipper_name", "Hpoole");
				Shipper.put("shipper_province", "Northern Zealand");
				Shipper.put("shipper_city", "Domino's Pizza Helsing03"); // TODO 待确认
				Shipper.put("shipper_street", "Domino's Pizza Helsing03");
				Shipper.put("shipper_postcode", "3000");
				Shipper.put("shipper_telephone", "3064854");
				Shipper.put("shipper_mobile", "");
				// 下单返回结果将XML返回结果转换为Map信息，xmlToMap={"SOAP-ENV:Body":{"ns1:callServiceResponse":{"response":"{\"ask\":\"Success\",\"message\":\"Success\",\"reference_no\":\"ANHETESTDK000111\",\"shipping_method_no\":\"517146424183\",\"order_code\":\"GWE240206GWE002740000251\",\"track_status\":1,\"sender_info_status\":1,\"ODA\":null,\"agent_number\":\"\",\"system_number\":null,\"tracking_number_list\":{\"U001\":\"517146424183\"},\"time_cost(s)\":2.8494799137115}"}}}
				// 打印面单返回结果：<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Success","message":"Success","Error":{"errCode":"","errMessage":""},"type":"pdf","url":"http:\/\/oms.gw-express.com.cn\/index\/get-label?code=GWE240206GWE002740000251&amp;other=0&amp;sign=43ca131f24ddc7b6","reference_no":"GWE240206GWE002740000251","time_cost(s)":0.057616949081421}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
			} else if("LU".equals(countryCode)) { // 卢森堡
				Shipper.put("shipper_name", "xuanzhe");
				Shipper.put("shipper_province", "Bastogne");
				Shipper.put("shipper_city", "Bastogne");
				Shipper.put("shipper_street", "19 Rte de Bastogne, 9638 Wiltz");
				Shipper.put("shipper_postcode", "6630");
				Shipper.put("shipper_telephone", "5521487");
				Shipper.put("shipper_mobile", "");
				// 将XML返回结果转换为Map信息，xmlToMap={"SOAP-ENV:Body":{"ns1:callServiceResponse":{"response":"{\"ask\":\"Success\",\"message\":\"Success\",\"reference_no\":\"ANHETESTLU000111\",\"shipping_method_no\":\"517146424199\",\"order_code\":\"GWE240206GWE002740000205\",\"track_status\":1,\"sender_info_status\":1,\"ODA\":null,\"agent_number\":\"\",\"system_number\":null,\"tracking_number_list\":{\"U001\":\"517146424199\"},\"time_cost(s)\":2.4890298843384}"}}}
				// <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Success","message":"Success","Error":{"errCode":"","errMessage":""},"type":"pdf","url":"http:\/\/oms.gw-express.com.cn\/index\/get-label?code=GWE240206GWE002740000205&amp;other=0&amp;sign=b6cfc33872f615fb","reference_no":"GWE240206GWE002740000205","time_cost(s)":0.046888828277588}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
			} else if("HU".equals(countryCode)) { // 匈牙利
				Shipper.put("shipper_name", "HEIQISHI");
				Shipper.put("shipper_province", "BUDAPEST");
				Shipper.put("shipper_city", "BUDAPEST");
				Shipper.put("shipper_street", "VIRÁG TÉR 3. IV. 61");
				Shipper.put("shipper_postcode", "1037");
				Shipper.put("shipper_telephone", "145879358");
				Shipper.put("shipper_mobile", "");
				// 将XML返回结果转换为Map信息，xmlToMap={"SOAP-ENV:Body":{"ns1:callServiceResponse":{"response":"{\"ask\":\"Success\",\"message\":\"Success\",\"reference_no\":\"ANHETESTHU000111\",\"shipping_method_no\":\"517146424206\",\"order_code\":\"GWE240206GWE002740000179\",\"track_status\":1,\"sender_info_status\":1,\"ODA\":null,\"agent_number\":\"\",\"system_number\":null,\"tracking_number_list\":{\"U001\":\"517146424206\"},\"time_cost(s)\":2.9316408634186}"}}}
				// <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Success","message":"Success","Error":{"errCode":"","errMessage":""},"type":"pdf","url":"http:\/\/oms.gw-express.com.cn\/index\/get-label?code=GWE240206GWE002740000179&amp;other=0&amp;sign=7b204f44939bb624","reference_no":"GWE240206GWE002740000179","time_cost(s)":0.045897960662842}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
			} else if("SK".equals(countryCode)) { // 斯洛伐克
				Shipper.put("shipper_name", "XIAYING");
				Shipper.put("shipper_province", "SLOVAKIA");
				Shipper.put("shipper_city", "Iveta Hololová");
				Shipper.put("shipper_street", "Kukucinova 34");
				Shipper.put("shipper_postcode", "1001");
				Shipper.put("shipper_telephone", "4789631578");
				Shipper.put("shipper_mobile", "");
			} else if("SI".equals(countryCode)) { // 斯洛文尼亚
				Shipper.put("shipper_name", "BINLEIS");
				Shipper.put("shipper_province", "SLOVENIA");
				Shipper.put("shipper_city", "Prodajalna AVTO-HIT");
				Shipper.put("shipper_street", "p.p. 1635");
				Shipper.put("shipper_postcode", "1001");
				Shipper.put("shipper_telephone", "4589637774");
				Shipper.put("shipper_mobile", "");
				// 将XML返回结果转换为Map信息，xmlToMap={"SOAP-ENV:Body":{"ns1:callServiceResponse":{"response":"{\"ask\":\"Success\",\"message\":\"Success\",\"reference_no\":\"ANHETESTSI000111\",\"shipping_method_no\":\"517146424228\",\"order_code\":\"GWE240206GWE002740000303\",\"track_status\":1,\"sender_info_status\":1,\"ODA\":null,\"agent_number\":\"\",\"system_number\":null,\"tracking_number_list\":{\"U001\":\"517146424228\"},\"time_cost(s)\":2.3710939884186}"}}}
				// <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Success","message":"Success","Error":{"errCode":"","errMessage":""},"type":"pdf","url":"http:\/\/oms.gw-express.com.cn\/index\/get-label?code=GWE240206GWE002740000303&amp;other=0&amp;sign=d535db323e83bb86","reference_no":"GWE240206GWE002740000303","time_cost(s)":0.064472913742065}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
			} else if("CZ".equals(countryCode)) { // 捷克
				Shipper.put("shipper_name", "Pan Martin Parma");
				Shipper.put("shipper_province", "SENOHRABY");
				Shipper.put("shipper_city", "SENOHRABY");
				Shipper.put("shipper_street", "Ladova 3/64");
				Shipper.put("shipper_postcode", "25166");
				Shipper.put("shipper_telephone", "1254854633");
				Shipper.put("shipper_mobile", "");
				// 将XML返回结果转换为Map信息，xmlToMap={"SOAP-ENV:Body":{"ns1:callServiceResponse":{"response":"{\"ask\":\"Success\",\"message\":\"Success\",\"reference_no\":\"ANHETESTCZ000111\",\"shipping_method_no\":\"517146424234\",\"order_code\":\"GWE240206GWE002740000167\",\"track_status\":1,\"sender_info_status\":1,\"ODA\":null,\"agent_number\":\"\",\"system_number\":null,\"tracking_number_list\":{\"U001\":\"517146424234\"},\"time_cost(s)\":2.4685242176056}"}}}
				// <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Success","message":"Success","Error":{"errCode":"","errMessage":""},"type":"pdf","url":"http:\/\/oms.gw-express.com.cn\/index\/get-label?code=GWE240206GWE002740000167&amp;other=0&amp;sign=d56db9863109a1a8","reference_no":"GWE240206GWE002740000167","time_cost(s)":0.046889066696167}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
			}
			paramObject.put("Shipper", Shipper);
		}

		JSONArray ItemArr = new JSONArray();
		JSONObject Item = new JSONObject();
		Item.put("invoice_cnname", "安和退货物品");
		Item.put("invoice_enname", "AnHeGoods");
		Item.put("invoice_weight", String.valueOf(DEFAULT_WEIGHT));
		Item.put("invoice_quantity", "1");
		Item.put("invoice_unitcharge", 0.01);
		Item.put("hs_code", "3506100001");
		Item.put("invoice_brand", "物品");
		Item.put("sku", "227652501");
		Item.put("box_number", "U001");
		Item.put("invoice_currencycode", CURRENCY); // TODO 申报币种，默认为USD(美元)
		ItemArr.add(Item);

		paramObject.put("ItemArr", ItemArr);

//		JSONArray Volume = new JSONArray();
//		JSONObject v = new JSONObject();
//		v.put("length", "10");
//		v.put("width", "10");
//		v.put("height", "10");
//		v.put("weight", "0.3");
//		v.put("box_number", "U001");
//		v.put("child_number", "TEST1234U001");
//		Volume.add(v);
//		paramObject.put("Volume", Volume);

//		<?xml version="1.0" encoding="UTF-8"?>
//		<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/">
//			<SOAP-ENV:Body>
//				<ns1:callService>			
//					<paramsJson>{json}</paramsJson>
//					<appToken>appToken</appToken>
//					<appKey>appKey</appKey>
//					<service>{service}</service>
//				</ns1:callService>
//			</SOAP-ENV:Body>
//		</SOAP-ENV:Envelope>

		StringBuilder request = new StringBuilder();
		request.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
		request.append(
				"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://www.example.org/Ec/\">");
		request.append("<SOAP-ENV:Body>");
		request.append("<ns1:callService>");
		request.append("<paramsJson>" + paramObject.toJSONString() + "</paramsJson>");
		request.append("<appToken>" + APP_TOKEN + "</appToken>");
		request.append("<appKey>" + APP_KEY + "</appKey>");
		request.append("<service>" + SERVICE + "</service>");
		request.append("</ns1:callService>");
		request.append("</SOAP-ENV:Body>");
		request.append("</SOAP-ENV:Envelope>");

		LOG.info("请求Gwe-DHL，url={}， request={}", API_URL, request.toString());

		String respBody = HttpRequest.post(API_URL).body(request.toString()).execute().body();

		LOG.info("获取Gwe-DHL返回信息respBody={}", respBody);

//		<?xml version="1.0" encoding="UTF-8"?>
//		<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Failure","message":"服务异常:订单数据不合法002","reference_no":"ANHETEST000001","Error":{"errMessage":"英文品名不能为空, 申报单价不能为空, 收件人地址1不能为空","errCode":"50048"},"time_cost(s)":0.10839796066284}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

		Map<String, Object> xmlToMap = XmlUtil.xmlToMap(respBody);

		LOG.info("将XML返回结果转换为Map信息，xmlToMap={}", JSON.toJSONString(xmlToMap));
//		{"SOAP-ENV:Body":{"ns1:callServiceResponse":{"response":"{\"ask\":\"Success\",\"message\":\"Success\",\"reference_no\":\"ANHETEST000001\",\"shipping_method_no\":\"GWE231113GWE002710000189\",\"order_code\":\"GWE231113GWE002710000189\",\"track_status\":3,\"sender_info_status\":0,\"ODA\":null,\"agent_number\":\"\",\"system_number\":null,\"tracking_number_list\":{\"U001\":\"GWE231113GWE002710000189\"},\"time_cost(s)\":0.701171875}"}}}
		JSONObject xmlObject = JSON.parseObject(JSON.toJSONString(xmlToMap));

		JSONObject SOAPBody = xmlObject.getJSONObject("SOAP-ENV:Body");
		JSONObject callServiceResponse = SOAPBody.getJSONObject("ns1:callServiceResponse");
		String resp = callServiceResponse.getString("response");
		JSONObject respObject = JSON.parseObject(resp);
		String ask = respObject.getString("ask");
		if ("Success".equals(ask)) {
			String shippingMethodNo = respObject.getString("shipping_method_no");
			LOG.info("DHL下单成功，单号shippingMethodNo={}", shippingMethodNo);
		} else {
			String message = respObject.getString("message");
			JSONObject errorObject = respObject.getJSONObject("Error");
			String errMessage = errorObject.getString("errMessage");
			String errCode = errorObject.getString("errCode");
			LOG.info("下单失败，错误信息message={}，错误码errCode={}，详细错误信息errMessage={}", message, errCode, errMessage);

		}

	}

	public static void printLabel(String referenceNo) {
		JSONObject paramObject = new JSONObject();
		paramObject.put("reference_no", referenceNo);
		paramObject.put("label_type", "3");

		StringBuilder request = new StringBuilder();
		request.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
		request.append(
				"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://www.example.org/Ec/\">");
		request.append("<SOAP-ENV:Body>");
		request.append("<ns1:callService>");
		request.append("<paramsJson>" + paramObject.toJSONString() + "</paramsJson>");
		request.append("<appToken>" + APP_TOKEN + "</appToken>");
		request.append("<appKey>" + APP_KEY + "</appKey>");
		request.append("<service>" + SERVICE_PRINT + "</service>");
		request.append("</ns1:callService>");
		request.append("</SOAP-ENV:Body>");
		request.append("</SOAP-ENV:Envelope>");

		String respBody = HttpRequest.post(API_URL).body(request.toString()).execute().body();

		LOG.info("获取标签信息resp={}", respBody);

// 		下单结果：将XML返回结果转换为Map信息，xmlToMap={"SOAP-ENV:Body":{"ns1:callServiceResponse":{"response":"{\"ask\":\"Success\",\"message\":\"Success\",\"reference_no\":\"ANHETESTCZ000111\",\"shipping_method_no\":\"517146424234\",\"order_code\":\"GWE240206GWE002740000167\",\"track_status\":1,\"sender_info_status\":1,\"ODA\":null,\"agent_number\":\"\",\"system_number\":null,\"tracking_number_list\":{\"U001\":\"517146424234\"},\"time_cost(s)\":2.4685242176056}"}}}
		
//		获取标签信息resp=<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/Ec/"><SOAP-ENV:Body><ns1:callServiceResponse><response>{"ask":"Success","message":"Success","Error":{"errCode":"","errMessage":""},"type":"pdf","url":"http:\/\/oms.gw-express.com.cn\/PDF\/7b7fdf91-82cd-462f-814e-1497361949a2.pdf","reference_no":"ANHETEST000001","time_cost(s)":1.8798830509186}</response></ns1:callServiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

	}
}
